import java.util.Scanner;

public class Answer1 {
    public static void main(String[] args) {
        // 牛牛的快递
        //https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270?tpId=290&tqId=39852&ru=/exam/oj
        Scanner in=new Scanner(System.in);

        double a=in.nextFloat();
        char ch=in.next().charAt(0);
        int sum=0;
        if(a<=1){
            sum=20;
        }else{
            sum+=20+(int)Math.ceil(a-1);
        }
        if(ch=='y'){
            sum+=5;
        }
        System.out.println(sum);
    }
}
